<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>X6 效果测试</title>
		<script src="jquery-3.6.min.js"></script>
		<script src="x6.min.js"></script>
		<script src="x6.layout.min.js"></script>
		<script src="mock.js"></script>
		<link rel="stylesheet" href="./mod/style/main.css">
		<link rel="stylesheet" href="./mod/style/actionMod.css">
		<script src="./tippy/popperjs.js"></script>
		<script src="./tippy/tippy.min.js"></script>
		<link rel="stylesheet" href="./tippy/tippy.css">
		<link rel="stylesheet" href="./mod/style/actionMod.css">
		<link rel="stylesheet" href="./mod/style/reactLMod.css">
		<script src="./mod/x6Main/hierarchy.min.js"></script>
		<script type="module">
			import x6MainFn from "./mod/x6Main/index.js";
			// import hierarchy from "./mod/x6Main/hierarchy.min.js";
			import nodeInfoModFn from "./tippy/nodeInfoMod.js";
			import {
				nodeConfig,
				X6Config
			} from "./mod/x6Main/X6ConfigFile.js";
			import {
				addBtnChildrenTool,
				addBtnParentTool,
				decreaseBtnChildrenTool,
				decreaseBtnParentTool
			} from "./mod/x6Main/tools.js";
			import actionMod from "./mod/html/actionMod.js";
			import reactLMod from "./mod/html/reactLMod.js";
			window.x6MainFn = x6MainFn;
			window.nodeInfoModFn = nodeInfoModFn;
			window.nodeConfig = nodeConfig;
			window.X6Config = X6Config;
			window.addBtnChildrenTool = addBtnChildrenTool;
			window.addBtnParentTool = addBtnParentTool;
			window.decreaseBtnChildrenTool = decreaseBtnChildrenTool;
			window.decreaseBtnParentTool = decreaseBtnParentTool;
			window.actionMod = actionMod;
			window.reactLMod = reactLMod;
			// window.hierarchy = hierarchy;
			// console.log("hierarchy", hierarchy)
		</script>
	</head>
	<style>
		html,
		body {
			height: 100%;
			width: 100%;
			margin: 0;
			padding: 0;
		}

		.all {
			height: 100%;
			width: 100%;
			overflow: auto;
		}

		#test {
			/**
            width: 100%;
            height: 100%;
            */
		}

		.topic-image {
			visibility: hidden;
			cursor: pointer;
		}

		.x6-node:hover .topic-image {
			visibility: visible;
		}

		.x6-node-selected rect {
			stroke-width: 2px;
		}
	</style>

	<body>
		<div class="all">
			<div id="test">testtesttesttest</div>
		</div>

	</body>

	<script type="text/javascript">
		var graph = ""; //初始化图形对象行数
		var mainFn = ""; //初始化核心函数对象
		var tippyList = [];
		var rootObj = {};
		var rootId = "";
		var nodeData = {
			nodes: [],
			edges: []
		};
		const typeList = {
			"0": "tab",
			"1": "api",
			"2": "str",
			"3": "report",
			"4": "reportForm",
			"5": "alarmScreen",
			"6": "dataSet"
		};
		var nodeTypeClass = {
			"tab": "表",
			"api": "API",
			"str": "字段",
			"report": "报告",
			"reportForm": "报表",
			"alarmScreen": "报屏",
			"dataSet": "数据集"
		};
		var selectedMod = false;
		var nodeDownFlag = false; //根节点是否有下游
		var nodeUpFlag = false; //根节点是否有上游
		$(document).ready(function() {
			console.log("11111111112")
			console.log("11111111112 X6.Graph", X6.Graph)
			setTimeout(function() {
				console.log("hierarchy  https://npmmirror.com/package/@antv/hierarchy", Hierarchy)
				initEdeg();
				init()
			}, 300)
		});
		//  初始化  x6布局 连线
		function initEdeg() {
			X6.Graph.registerEdge("custom-edge-label", {
				inherit: "edge",
				defaultLabel: {
					markup: [{
						tagName: "rect",
						selector: "body",
					}, {
						tagName: "text",
						selector: "label",
					}, ],
					attrs: {
						label: {
							fill: "#000",
							fontSize: 14,
							textAnchor: "middle",
							textVerticalAnchor: "middle",
							pointerEvents: "none",
						},
						body: {
							ref: "label",
							fill: "#ffd591",
							stroke: "#ffa940",
							strokeWidth: 2,
							rx: 4,
							ry: 4,
							refWidth: "140%",
							refHeight: "140%",
							refX: "-20%",
							refY: "-20%",
						},
					},
					position: {
						distance: 0.5,
						options: {
							absoluteDistance: true,
							reverseDistance: true,
						},
					},
					zIndex: 0,
				},
			}, true);
		}

		// 初始化  x6  布局
		function init() {
			// 连接器
			X6.Graph.registerConnector(
				'mindmap',
				(sourcePoint, targetPoint, routerPoints, options) => {
					const midX = sourcePoint.x + 6
					const midY = sourcePoint.y
					const ctrX = (targetPoint.x - midX) / 3 + midX + 10
					const ctrY = targetPoint.y
					const pathData = `
		     M ${sourcePoint.x} ${sourcePoint.y}
		     L ${midX} ${midY}
		     Q ${ctrX} ${ctrY} ${targetPoint.x} ${targetPoint.y}
		    `
					return options.raw ? X6.Path.parse(pathData) : pathData
				},
				true,
			)

			//初始化  函数内容
			let w = $(".all").width();
			let h = $(".all").height();
			console.log("w:", w, "  h:", h)

			graph = new X6.Graph({
				container: document.getElementById('test'),
				width: w,
				height: h,
				scroller: {
					enabled: true, //滚动
					className: "my-scroller",
				},
				panning: {
					// enabled: true, //画布可以平移
					//还可以配置 eventTypes 来设置触发画布拖拽的行为，支持 leftMouseDown、 rightMouseDown、mouseWheel，默认为 ['leftMouseDown'] 。
					eventTypes: ["leftMouseDown", "rightMouseDown", "mouseWheel"],
				},
				// async: true,
				// frozen: true,
				scroller: true, //滚动条
				// interacting: false,
				background: {
					color: "#fffbe6", // 设置画布背景颜色
				},
				selecting: {
					enabled: false,
					rubberband: true,
					showNodeSelectionBox: true,
				},
				grid: {
					size: 10, // 网格大小 10px
					visible: false, // 渲染网格背景
					// color:"#fff"
				},
				interacting: {
					'nodeMovable': false, // 节点是否可以被移动。
				},
				connecting: {
					connector: "mindmap", //'smooth',//连线样式  smooth  曲线
				},
			});
			mainFn = x6MainFn(graph);
			layoutMain(); //布局函数
			clickAction(); //绑定事件

			getData({
				id: 'root',
				root: true
			})
		}

		function getData({
			id = "",
			root = false,
			type = "0",
			dir = "down"
		}) {
			if (id == 'root' && root) {
				// alert("返回根节点数据")
				mainFn.resetCells(); //清空数据
				console.log("返回根节点数据")
				let resultBlock = getMockData({
					root: true
				}); //当前数据对象
				let resultBlockSrc = getMockData(); //上游数据对象
				let resultBlockDst = getMockData(); //下游数据对象

				rootObj = resultBlock[0]
				rootId = resultBlock[0].uuid

				//初始化根节点
				nodeData = {
					nodes: [],
					edges: []
				}; //数据清零
				let type = typeList[rootObj.objType];
				let rootNode = createNode({
					id: rootObj.nodeUuid,
					dir: "",
					type,
					root,
					text: rootObj.objName,
					data: rootObj
				})
				nodeData.nodes.push(rootNode);
				layoutMain(); //布局函数
				//循环创建上下游节点
				let node = mainFn.getById(rootObj.nodeUuid);
				//创建下游节点
				if (resultBlockDst && resultBlockDst.length > 0) {
					nodeDownFlag = true;
					resultBlockDst.map(item => {
						let typeStr = typeList[item.objType];
						add(node, "down", {
							id: item.nodeUuid,
							dir: "down",
							type: typeStr,
							text: item.objName,
							data: item
						})
					})
				}

				if (resultBlockSrc && resultBlockSrc.length > 0) {
					nodeUpFlag = true;
					resultBlockSrc.map(item => {
						let typeStr = typeList[item.objType];
						add(node, "up", {
							id: item.nodeUuid,
							dir: "up",
							type: typeStr,
							text: item.objName,
							data: item
						})
					})

				}
			} else {
				//处理子节点
				let resultBlockSrc = getMockData(); //上游数据对象
				let resultBlockDst = getMockData(); //下游数据对象

				if (dir == "down") {
					resultBlockDst.map(item => {
						let typeStr = typeList[item.objType];
						add(window.selectNode, "down", {
							id: item.nodeUuid,
							dir: "down",
							type: typeStr,
							text: item.objName,
							data: item
						})
					})
				}
				if (dir == "up") {
					resultBlockSrc.map(item => {
						let typeStr = typeList[item.objType];
						add(window.selectNode, "up", {
							id: item.nodeUuid,
							dir: "up",
							type: typeStr,
							text: item.objName,
							data: item
						})
					})
				}
			}
		}
		//布局函数
		function layoutMain() {
			graph.freeze();
			let hideNodeList = mainFn.nodeIsShowFn(); //获取要隐藏的节点
			const {
				DagreLayout
			} = window.layout;
			const dagreLayout = new DagreLayout({
				type: "dagre",
				rankdir: "LR",
				align: "",
				ranksep: X6Config.ranksep,
				nodesep: X6Config.nodesep,
				controlPoints: true,
			});
			if (nodeData && nodeData.nodes[0]) {
				let nodes = mainFn.getNodes();

				const newModel = dagreLayout.layout(nodeData);
				graph.fromJSON(newModel);
				//隐藏对应节点
				for (const key in hideNodeList) {
					if (hideNodeList.hasOwnProperty.call(hideNodeList, key)) {
						const element = hideNodeList[key];
						element.map((item) => {
							let node = mainFn.getById(item);
							node.data.showFlag = false;
							node.setVisible(false, {
								silent: false
							})
						});
					}
				}
			}
			graph.unfreeze();
		}

		//添加节点步骤
		function add(node, dir, data) {
			//接口数据获取   这里使用随机数1就添加节点，0就结束步骤
			if (data) {

				addNode(node, dir, data);
			} else {
				// 没有查询到数据即为叶子节点
				let dataObj = {
					leafNode: true
				};
				if (dir == "up") {
					dataObj = {
						leafNodeUP: true
					};
				}

				let leafNode = findNodeFn({
					id: node.id,
					data: dataObj
				}); //设置为叶子节点
				selectNode = leafNode;
				// addEndNode(node, dir);
			}
		}
		//创建节点数据结构
		function createNode({
			id = new Date().getTime(),
			root = false,
			dir = "down",
			type = "tab",
			text = "test text",
			time = new Date().toString(),
			tools = true,
			data = {}
		}) {
			let title = nodeTypeClass[type];
			return {
				id: id,
				width: nodeConfig.nodeWidth,
				height: nodeConfig.nodeHeight,
				shape: "html",
				data: {
					id: id,
					time,
					type,
					dir,
					showFlag: true,
					rootId: rootId,
					root: root,
					title: title,
					text: text,
					tools,
					...data
				},

				html: {
					render(node) {
						const data = node.getData();
						// return actionMod(data);
						return reactLMod(data);
					},
					shouldComponentUpdate(node) {
						// 控制节点重新渲染
						return node.hasChanged("data");
					},
				},
				ports: {
					groups: {
						left: {
							position: 'left',
							attrs: {
								circle: {
									magnet: false,
									stroke: 'red',
									strokeWidth: 0,
									fill: 'red',
									stroke: 'red',
									r: 0,

								},
							},
						},
						right: {
							position: 'right',
							attrs: {
								circle: {
									magnet: false,
									stroke: 'red',
									strokeWidth: 0,
									fill: 'red',
									stroke: 'red',
									r: 0,

								},
							},
						}

					},
					items: [{
						id: 'port',
						group: 'left',
					}, {
						id: 'port2',
						group: 'right',
					}, ]
				}
			};
		}

		//添加节点
		function addNode(node, dir, data) {

			let nodeObj = createNode(data)

			let parentNode = {};
			let childrenNode = {};
			let parentId = "";
			if (node && dir == "down") {
				//有指定节点就使用指定节点
				parentId = node.id;
				parentNode = node;
				// nodeObj.parent = parentId;
			} else if (node && dir == "up") {

				let childId = node.id;
				let childNode = mainFn.getById(childId);
				// childNode.parent =nodeObj.id
				//nodeObj.children = childId;
			}
			nodeData.nodes.push(nodeObj);

			nodeData.edges.push({
				// source: dir == "down" ? node.id : nodeObj.id,
				// target: dir == "down" ? nodeObj.id : node.id,
				source: dir == "down" ? {
					cell: node.id,
					port: "port2",
				} : {
					cell: nodeObj.id,
					port: "port2",
				},
				target: dir == "down" ? {
					cell: nodeObj.id,
					port: "port",
				} : {
					cell: node.id,
					port: "port",
				},
				shape: "custom-edge-label", // labels: ["步骤过程"],
				zIndex: -1,
				attrs: {
					line: {
						stroke: "#A2B1C3",
						strokeWidth: 2,
						// targetMarker: null, //箭头
					},

				},
				data: {
					dir
				}
			});
			layoutMain();

			if (node && dir == "down") {
				let tempNode = mainFn.getById(nodeObj.id);
				parentNode.addChild(tempNode);
				// if (parentNode.children) {
				//         parentNode.children.push(tempNode)
				//       } else {
				//         parentNode.children = [tempNode]
				//       }
			} else if (node && dir == "up") {
				parentNode = mainFn.getById(nodeObj.id);
				let childNode = mainFn.getById(node.id);
				parentNode.addChild(childNode);
				//childNode.insertTo(parentNode);
				/* if (parentNode.children) {
				        parentNode.children.push(childNode)
				      } else {
				        parentNode.children = [childNode]
				      } */
			}


		}
		//绑定事件
		function clickAction() {
			graph.on("node:mousedown", ({
				e,
				x,
				y,
				node,
				view
			}) => {
				//点击节点
				console.log("node", node)
				if (selectedMod) {
					setTimeout(() => {
						let obj = $("#modBody" + node.id).parent(".reactLBody");
						obj.addClass("selectedMod2")
					}, 200)
				}
				selectNode = node;
				selectEdge = {}
				let str = nodeInfoModFn(node.data.objType); //

				if (selectNode && selectNode.data && selectNode.data.info && selectNode.data.info.objIsExist ==
					"false") {
					alert("该对象已不存在", "warning")
					$(".tippy-box").hide();
					setTimeout(() => {
						$(".tippy-box").hide()
					}, 10)
					return
				}

				let instances1 = tippy("#modBody" + node.id, {
					appendTo: () => document.body,
					placement: "top-start",
					arrow: true,
					animation: "scale",
					// theme: "light",
					trigger: "click",
					content: str,
					allowHTML: true,
					interactive: true, //交互
					// appendTo: "parent",
					onShow(instance) {
						setTimeout(() => {
							showNodeInfo()
						}, 20)

					}
				});
				for (let i = 0; i < tippyList.length; i++) {
					let element = tippyList[i];
					try {
						element.destroy ? element.destroy() : "";
					} catch (e) {
						console.log("error", e)
					}
				}
				tippyList.length = 0;
				tippyList.push(instances1[0]);
				// instances1[0].show();
				showNodeDetail(node)

			});
			graph.on("edge:mousedown", ({
				e,
				x,
				y,
				edge,
				view
			}) => { //边的点击
				selectEdge = edge;
				selectNode = {}
				// edgeClickAction({e, x, y, edge, view})
			});
			graph.on("blank:click", ({
				e,
				x,
				y
			}) => {
				//点击空白
				hoverNode = null;
			});
			graph.on("node:mouseenter", ({
				e,
				x,
				y,
				node
			}) => { //节点移入
				let data = node.getData();
				let id = node.id;
				hoverNode = node;
				$(".x6-graph-scroller").focus();
				selectNode = node;
				if (data.root) {
					//根节点处理
					getRootTools(node);
				} else if (data.dir == "down" && data.tools) {
					//下游节点处理
					getDownTools(node);
				} else if (data.dir == "up" && data.tools) {
					//上游节点处理
					getUpTools(node);
				}
			});
			graph.on("node:mouseleave", ({
				e,
				x,
				y,
				node
			}) => { //节点移出
				//移出
				hoverNode = null;
				node.removeTools();
			});
			graph.on("edge:mouseenter", ({
				e,
				x,
				y,
				edge
			}) => { //边移入

				let riskCount = edge.data && edge.data.riskCount ? edge.data.riskCount : 0
				if (riskCount) {
					// edge.appendLabel({ attrs: { label: { text: "风险数量："+riskCount } },})
					edge.setLabels([{
						attrs: {
							label: {
								text: "风险数量：" + riskCount
							}
						}
					}])
					edge.setZIndex(888);
				}

			});
			graph.on("edge:mouseleave", ({
				e,
				x,
				y,
				edge
			}) => { //边移出
				//移出
				// edge.removeLabelAt(0)
				edge.labels = {}
				let riskCount = edge.data && edge.data.riskCount ? edge.data.riskCount : 0

				if (riskCount) {
					edge.setZIndex(-1);
				}

			});
		}


		//根节点工具
		function getRootTools(node) {

			if (nodeDownFlag) {
				getDownTools(node);
			}
			if (nodeUpFlag) {
				getUpTools(node);
			}

		}

		//下游节点工具处理
		function getDownTools(node) {
			//开始隐藏节点
			let childrenFlag = mainFn.getEdges().find((item) => {
				return item.source.cell == node.id;
			});
			if (!childrenFlag && !node.data.leafNode) {
				//没有子节点
				//node.addTools(addBtnChildrenTool(this.add));
				node.addTools(addBtnChildrenTool(addNodeChildren));
			} else {
				if (!node.data.leafNode && childrenFlag) { //非叶子节点才有工具
					//有子节点 使用显示或隐藏
					let child = mainFn.getById(childrenFlag.target.cell);
					let item = child[0] ? child[0] : child;
					if (item.visible) {
						//添加隐藏工具
						node.addTools(decreaseBtnChildrenTool(hideCell));
					} else {
						//添加显示工具
						node.addTools(addBtnChildrenTool(showCell));
					}
				}
			}
		}

		//上游节点工具处理
		function getUpTools(node) {
			let parentFlag = mainFn.getEdges().find((item) => {
				return item.target.cell == node.id;
			});

			if (!parentFlag && !node.data.leafNodeUP) {
				node.addTools(addBtnParentTool(addNodeParent));
			} else {
				if (!node.data.leafNodeUp && parentFlag) { //非叶子节点才有工具
					//有子节点 使用显示或隐藏
					let parent = mainFn.getById(parentFlag.source.cell);
					let item = parent[0] ? parent[0] : parent;

					if (item.visible) {
						//添加隐藏工具
						node.addTools(decreaseBtnParentTool(hideCell));
					} else {
						//添加显示工具
						node.addTools(addBtnParentTool(showCell));
					}
				}

			}
		}
		//显示节点详情
		function showNodeDetail(node) {
			try {
				let nodeInfo = node.data.info;
				if (!nodeInfo) {
					queryDetailFn();
				} else {
					showNodeInfo();
				}
			} catch (e) {
				console.log("error", e)
			}
		}
		//请求  详情信息
		function queryDetailFn() {
			console.log("请求  详情信息")
		}
		// 根据详情显示内容
		function showNodeInfo() {
			try {
				$("body").removeClass("ei-tippyStyle")
				$("#tableEname").html("")
				$("#tableCname").html("")
				$("#dbEngineName").html("")
				$("#itemSchema").html("")
				$("#projectName").html("")
				$("#apiName").html("")
				$("#modelId").html("")
				$("#apiStatus").html("")
				$("#apiDesc").html("")
				$("#itemType").html("")
			 $("#fieldEname").html("")
				$("#fieldCname").html("")
				$("#fieldType").html("")
				$("#fieldLen").html("")
				$("#pageEname").html("")
				$("#pageEname2").html("")
				$("#pageCname").html("")
				$("#desc").html("")
				$("#isAuth").html("")
				$("#isPublic").html("")
				$("#isOn").html("")

				if (selectNode && selectNode.data) {
			 	$("#tableEname").html(Mock.mock('@word(3, 15)'));
					$("#tableCname").html(Mock.mock('@csentence(3, 15)'));
					$("#dbEngineName").html(Mock.mock('@title'));
					$("#itemSchema").html(Mock.mock('@title'));
					$("#projectName").html(Mock.mock('@csentence(3, 15)'));
					$("#apiName").html(Mock.mock('@csentence(3, 15)'));
					$("#modelId").html(Mock.mock('@id'));
					$("#apiStatus").html(Mock.mock('@cword("开关")'));
					$("#apiDesc").html(Mock.mock('@ctitle()'));
					$("#fieldEname").html(Mock.mock('@title(5)'));
					$("#fieldCname").html(Mock.mock('@ctitle()'));
					$("#fieldType").html(Mock.mock('@title(5)'));
					$("#fieldLen").html(Mock.mock('@title(5)'));
					$("#itemType").html(Mock.mock('@title(5)'));

					$("#fieldLen").html(Mock.mock('@title(5)'))
					$("#pageEname").html(Mock.mock('@title(5)'))
					$("#pageEname2").html(Mock.mock('@title(5)'))
					$("#pageCname").html(Mock.mock('@ctitle()'))
					$("#desc").html(Mock.mock('@ctitle()'))
					$("#isAuth").html(Mock.mock('@cword("是否")'))
					$("#isPublic").html(Mock.mock('@cword("是否")'))
					$("#isOn").html(Mock.mock('@cword("开关")'))

					$(".svgbox").hide();
				} else {
					$("#itemType").html(selectNode.data.title);

					if (obj && obj.time) {
						setTimeout(() => {
							$(".svgbox").hide();
						}, obj.time)
					}
				}
			} catch (e) {
				console.log("function ", arguments, " error", e)
			}
		}


		//显示相关节点和边
		function showCell(node, dir) {
			let id = node.id;
			let edges = mainFn.getEdges();
			for (let i = 0; i < edges.length; i++) {
				let item = edges[i];
				if (dir == "down") {
					//处理子节点
					if (item.source.cell == id) {
						let target = item.target.cell;
						let targetNode = mainFn.getById(target);
						targetNode.data.showFlag = true;
						targetNode.setVisible(true)
					}

				} else if (dir == "up") {
					//处理父节点
					if (item.target.cell == id) {
						let source = item.source.cell;
						let sourceNode = mainFn.getById(source);
						sourceNode.data.showFlag = true;
						sourceNode.setVisible(true, {
							silent: false
						})
					}
				}
			}
			node.removeTools();
			layoutMain();
		}
		//隐藏相关节点和边
		function hideCell(node, dir) {
			let id = node.id;
			findNode(id);

			function findNode(id) {
		 	let edges = mainFn.getEdges();

				edges.map((item) => {
					if (dir == "down") {
						//处理子节点
						let source = item.source.cell;
						if (source == id) {
							let target = item.target.cell;
							let targetNode = mainFn.getById(target);
							targetNode.data.showFlag = false;
							targetNode.setVisible(false)
							findNode(targetNode.id);
						}
					} else if (dir == "up") {
						//处理父节点
						let target = item.target.cell;
		 			if (target == id) {
							let source = item.source.cell;
							let sourceNode = mainFn.getById(source);
							sourceNode.data.showFlag = false;
							sourceNode.setVisible(false)
							findNode(sourceNode.id);
						}
					}
		 	});
			}

			node.removeTools();
			// layoutMain();
		}
		// 添加子节点
		function addNodeChildren(node, dir) {

			selectNode = node;

			console.log("node", node)
			getData({
				id: node.data.uuid,
				type: node.data.objType,
				dir
			})
		}

		// 添加父节点
		function addNodeParent(node, dir) {
			selectNode = node;
			console.log("node", node)
			getData({
				id: node.data.uuid,
				type: node.data.objType,
				dir
			})
		}
		// 返回  模拟数据
		function getMockData(obj) {
			let arr = []
			if (obj && obj.root) { //根节点
				arr = [{
					"objType": Mock.mock('@integer(0, 6)'), // 类型  数字
					"objName": Mock.mock('@ctitle(6, 15)'), //节点名称
					"firstLevelEname": Mock.mock('@ctitle(4, 9)'), //层级名称
					"uuid": Mock.mock('@id'), //  节点uuid
					"nodeUuid": Mock.mock('@id'), // 节点标识id 随机唯一
				}]
			} else {
				let num = Mock.mock('@natural(0, 5)')
				for (let i = 0; i < num; i++) {
					let temoObj = {
						"objType": Mock.mock('@integer(0, 6)'), // 类型  数字
						"objName": Mock.mock('@ctitle(6, 15)'), //节点名称
						"firstLevelEname": Mock.mock('@ctitle(4, 9)'), //层级名称
						"uuid": Mock.mock('@id'), //  节点uuid
						"nodeUuid": Mock.mock('@id'), // 节点标识id 随机唯一
					}
					arr.push(temoObj)
				}
			}


			return arr
		}
	</script>

</html>
